﻿using System;
using System.Collections.Generic;
using System.Text;

namespace FySystem.Net.FyHttp
{
    [Obsolete("C#的HttpClient蛮好的，不需要了这个类了")]
    public class FyHttpHeaders
    {
        public List<KVString> Headers = new List<KVString>();

        public FyHttpHeaders() { }

        public FyHttpHeaders(string key, string value)
        {
            Headers.Add(new KVString() { Key = key, Value = value });
        }

        /// <summary>
        /// 添加Head
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public FyHttpHeaders Add(string key, string value)
        {
            Headers.Add(new KVString() { Key = key, Value = value });
            return this;
        }

        /// <summary>
        /// 添加Head
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public FyHttpHeaders Add(KVString param)
        {
            Headers.Add(param);
            return this;
        }

        /// <summary>
        /// 判断是否有Head
        /// </summary>
        /// <returns></returns>
        public bool HasHeads()
        {
            if (Headers == null)
                return false;
            else if (Headers.Count == 0)
                return false;
            
                return true;
        }
    }
}
